﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using CRMBiz;
using Newtonsoft.Json;

namespace CRMWeb.WebServices
{
    /// <summary>
    /// Summary description for SearchCombineApplicants
    /// </summary>
    public class SearchCombineApplicants : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            try
            {
                int input_app_id = string.IsNullOrEmpty(context.Request.QueryString["app_id"]) ? 0 : int.Parse(context.Request.QueryString["app_id"]);

                DataTable dt = ClientProfileHandler.SearchCombineApplicants(input_app_id);
                string strJson = JsonConvert.SerializeObject(dt);
                if (strJson == "[]")
                {
                    context.Response.Write("0");
                }
                else
                {
                    context.Response.Write(strJson);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}